<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Bryce Sunrise
Description: A three-column, fixed-width blog design.
Version    : 1.0
Released   : 20100501

-->
<%@include file="../includes/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
    function obtenerMensajeCamposObligatiorios(){
        //formVentas cboLocales  txtNombre
        var cboActividades = document.forms['formPaquetes'].cboActividades;
        

        if(cboActividades.value == ""){
            return '<bean:message key="error.mensaje.datos.obligatorios"  />';
        }

      return "";
    }
       function registrar(){
        var mensaje = obtenerMensajeCamposObligatiorios();
        if(mensaje == ""){
           document.forms["formPaquetes"].accion.value = "registrar"
           document.forms["formPaquetes"].submit();
        }else{
           alert(mensaje);
        }

    }
   function agregarOpcion(){
       var existe = "N";
       var combo  = document.getElementById("cboActividades")
       var codigo = combo.value;
       var texto = combo.options[combo.selectedIndex].text;

       var combo2  = document.getElementById("cboActividades2")

       var i;
       for (i = combo2.length - 1; i>=0; i--) {
           combo2.options[i].selected = true;
          if (combo2.options[i].value == codigo ) {
              existe = "S";
        }
      }
      if (existe == "N") {

          AddItemtoList("cboActividades2",codigo,texto,codigo);
      }

        //AddItemtoList("cboActividades2",codigo,texto,null);

       }
   function quitarOpcion(){
       var combo  = document.getElementById("cboActividades2")
       var indice = combo.selectedIndex;
       combo.remove(indice);

       }






</script>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Proyecto Web GYM</title>
<meta name="keywords" content="" />
<meta name="Bryce Sunrise" content="" />

</head>
<body>
<!-- start header -->
<div id="header">
<%@include file="../includes/menu.jsp"%>

</div>
<!-- end header -->
<div id="wrapper">
  <!-- start page -->
  <div id="page">
    <table width="384" border="0">
              <tr>
                <td width="400" height="35"><p class="Estilo1">REGISTRO DE PAQUETES</p>
                <p class="Estilo1">&nbsp;</p></td>
    </tr>
                 </table>
      <!-- start content -->
      <!-- end content -->
      <!-- start sidebars -->
    
    <div id="sidebar1" class="sidebar">

<!-- crear el form -->
<form id="formPaquetes" action ="${ctx}/PaquetesServlet" method ="post">
    <input type="hidden" name ="accion" value ="registrar"></input>

 <table width="384" border="0">
          <tr>
            <td width="400" height="35"><p class="Estilo1"></p>
                <p class="mensajeError">&nbsp;
                    <c:if test="${MENSAJE_REQUEST != null}">
                        <bean:message key="${MENSAJE_REQUEST}" />
                    </c:if>
                </p>
            </td>
          </tr>
       </table>

<div id="sidebar1" class="sidebar">
<table width="200" border="0">
  
  <tr>
    <td>Paquete : </td>
    <td><input type="text" name="txtNombre" size="8" maxlength="50"/>&nbsp;<font size=1>(*)</font></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Descripcion  :</td>
    <td><input type="text" name="txtDescripcion" maxlength="50"/></td>
    <td>&nbsp;<font size=1>(*)</font></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Actividades:      </td>
    <td >
        <select name="cboActividades" id="cboActividades" multiple="multiple" style="width:150px;" size="8">
          <c:forEach items="${LISTA_ACTIVIDADES_CONTEXTO}" var="actividad" >
              <c:if test="${actividad.codigo == request.cboActividades}" >
              <option value="${actividad.codigo}" selected>${actividad.nombre}</option>
              </c:if>
              <c:if test="${actividad.codigo != request.cboActividades}" >
              <option value="${actividad.codigo}">${actividad.nombre}</option>
              </c:if>
          </c:forEach>
        </select>
    </td>
    <td>
        <input type="botton" name="Submit" value="agregar >>" class="boton" onclick="agregarOpcion()" />
      <input type="botton" name="Submit" value="<< retirar" class="boton" onclick="quitarOpcion()" />    </td>
    <td><select name="cboActividades2" id="cboActividades2" multiple="multiple" style="width:150px;" size="8" onclick= "javascript:void(0);" onkeyup="javascript:void(0);" onchange="javascript:void(0);" onkeydown="javascript:void(0);" >
      
    </select></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Costo S/. : </td>
    <td><input type="text" name="txtCosto" onkeypress="return onlyNumbers(event)" maxlength="10" /></td>
    <td>&nbsp;<font size=1>(*)</font></td>
  </tr>
  <tr>
    <td>Meses :</td>
    <td><select name="cboTiempo">
      <option value="1" selected="selected">1 mes</option>
      <option value="2" >2 mes</option>
      <option value="3">3 mes</option>
      <option value="4">4 mes</option>
      <option value="5">5 mes</option>
      <option value="6">6 mes</option>
      <option value="7">7 mes</option>
      <option value="8">8 mes</option>
      <option value="9">9 mes</option>
      <option value="10">10 mes</option>
      <option value="11">11 meses</option>
      <option value="12">12 meses</option>
      
    </select></td>
    
    
  </tr>
    <tr>
              <td>&nbsp;</td>
          </tr>
  <tr>
	<td colspan="4" ><div align="center">
	  <input name="Submit" type="button" class="boton" value="Grabar" onclick="registrar()" />
	
	  <input name="Submit2" type="button" class="boton" value="Cancelar" />
	</div></td>
  </tr>
</table>
 </div>
 <td>&nbsp;&nbsp;<font size=1>(*)&nbsp;Campos Obligatorios.</td>
</form>

    </div>
   
    <!-- end sidebars -->
    <div style="clear: both;">&nbsp;</div>
  </div>
  <!-- end page -->
  
</div>
<div id="footer">
  <div id="footer-content">
   
  </div>
</div>
</body>
</html>
